package com.hdoit.ares.selfcommon.utils;

import java.util.Date;

import com.hdoit.ares.logical.insu.model.FanhuaCar;

public class FanhuaCarStateUtil {

public static void changeState(FanhuaCar fanhuaCar){
		
		Date statetime = fanhuaCar.getBizInsureInfoStartDate();
		Date endtime = fanhuaCar.getBizInsureInfoEndDate();
		Date nowtime = new Date();
			
		long statetimeLong = statetime.getTime();		
		long endtimeLong = endtime.getTime();		
		long nowtimeLong =nowtime.getTime();
		
		if(nowtimeLong<statetimeLong){
			fanhuaCar.setInsuState("ready");
		}
		if(nowtimeLong>statetimeLong && nowtimeLong<endtimeLong){
			fanhuaCar.setInsuState("ok");
		}
		if(nowtimeLong>endtimeLong){
			fanhuaCar.setInsuState("no");
		}

	}
}
